import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/logex/order/list',
    method: 'get',
    params: query
  })
}

export function listOrderNew(query) {
  return request({
    url: '/logex/norder/list',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(id) {
  return request({
    url: '/logex/order/' + id,
    method: 'get'
  })
}

// 新增订单
export function addOrder(data) {
  return request({
    url: '/logex/order',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/logex/order',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delOrder(id) {
  return request({
    url: '/logex/order/' + id,
    method: 'delete'
  })
}

// 预定列表
export function getRecordList(query) {
  return request({
    url: '/logex/order/getRecordList',
    method: 'get',
    params: query
  })
}

// 酒店预定记录
export function getHotelRecordList(query) {
  return request({
    url: '/logex/orderRoom/getRecordList',
    method: 'get',
    params: query
  })
}

// 就餐记录
export function getOrderFoodList(query) {
  return request({
    url: '/logex/orderFood/getRecordList',
    method: 'get',
    params: query
  })
}

export function getOrderCarList(query) {
  return request({
    url: '/logex/orderCar/getRecordList',
    method: 'get',
    params: query
  })
}

export function getOrderById(id) {
  return request({
    url: '/logex/norder/getOrderById',
    method: 'get',
    params: { id }
  })
}

export function getRoomOrderInfoByOrderId(orderId) {
  return request({
    url: '/logex/orderRoom/getRoomOrderInfoByOrderId',
    method: 'get',
    params: { orderId }
  })
}

export function getRestaurantlById(id) {
  return request({
    url: '/logex/activityRestaurant/getRestaurantlById?',
    method: 'get',
    params: { id }
  })
}


export function updateMark(data) {
  return request({
    url: '/logex/norder/updateMark',
    method: 'put',
    data: data
  })
}

// 取消订单
export function orderCancel(id) {
  return request({
    url: '/logex/norder/cancelOrderBack/' + id,
    method: 'post'
  })
}

// 退款
export function orderBack(id) {
  return request({
    url: '/logex/norder/unSubscribeOrderBack/' + id,
    method: 'post'
  })
}


